using System;
using System.Collections;
using System.Collections.Generic;

namespace System.Data
{
	public abstract class EnumerableRowCollection : IEnumerable
	{
		DataTable table;

		internal EnumerableRowCollection ()
		{
		}

		internal DataTable Table {
			get {
				if (table == null)
					foreach (DataRow r in this) {
						table = r.Table;
						break;
					}
				return table;
			}
		}

		IEnumerator IEnumerable.GetEnumerator ()
		{
			// it is the documented behavior.
			return null;
		}
	}
}
